-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ECO-5009][CHA-RL1] Room ATTACH #27
Conversation
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
messages, typing and reactions channel attach fails
extends internal eventemitter
34add29
to
8ffabb1
Compare
…ssing impl. for EventEmitter apply
RoomLifecYCLE management
# Conflicts: # chat-android/src/main/java/com/ably/chat/RoomOptions.kt # chat-android/src/main/java/com/ably/chat/RoomStatus.kt
…ributor across all contributors and initialized RoomLifeCycle inside Room
attach method to call lifecyclemanager attach method instead
1f5623f
to
2c3655a
Compare
…ssing attach suspending method
2c3655a
to
b5a5e54
Compare
@@ -3,105 +3,106 @@ package com.ably.chat | |||
/** | |||
* Error codes for the Chat SDK. | |||
*/ | |||
object ErrorCodes { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you think enum here is better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having type for given ErrorCode
enforces compile time check for right assertions with reusability.
Also, IDE gives proper suggestions when matching error codes, unlike when it's generic Int
.
This makes it easy to write ErrorCode assertions in code as well as tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, in chat-js, ErrorCode
is represented as an enum, this makes it super easy to correlate between two codebases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I understand, could you give an example? Typescript's enums are nothing like Kotlin's enums. Error codes usually come from backend, and they come as Int
. I currently don't understand what benefits we get, except we have to additionally serialize/deserialize Int
into enum
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I am closing this PR in favor of #33. We can continue discussion for the same there 👍
@@ -118,3 +162,60 @@ data class RoomStatusChange( | |||
*/ | |||
val error: ErrorInfo? = null, | |||
) | |||
|
|||
open class RoomStatusEvenEmitter : EventEmitter<RoomLifecycle, RoomStatus.Listener>() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here is typo in the name, should be ...EventEmitter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed ce9c0ba
} | ||
} | ||
|
||
class DefaultStatus(private val logger: LogHandler?) : InternalRoomStatus, RoomStatusEvenEmitter() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not Kotlin idiomatic to use inheritance here. It's much better to use composition
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed ce9c0ba
Refactored DefaultStatus, using composition over inheritance for RoomStatusEventEmitter
# Conflicts: # chat-android/src/main/java/com/ably/chat/RoomReactions.kt
b8c3cc7
to
d689419
Compare
Superseded by #33 |
Fixed #21